import { DEFAULT_LAYOUT, PAGE_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const DECO_SCM: AppRouteRecordRaw = {
  path: '/deco-scm',
  name: 'DecoHom',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: '供应链',
    requiresAuth: true,
    icon: 'icon-dashboard',
    order: 0,
  },
  children: [
    {
      path: '/deco-scm-material',
      name: 'DecoScmMaterial',
      component: () => import('@/views/deco/scm/material/list/index.vue'),
      meta: {
        locale: '材料管理',
        requiresAuth: true,
        roles: ['*'],
      },
    },
    {
      path: '/deco-scm-agency',
      name: 'DecoScmAgency',
      component: PAGE_LAYOUT,
      meta: {
        locale: '供应商管理',
        requiresAuth: true,
        icon: 'icon-dashboard',
        order: 0,
      },
      children: [
        {
          path: '/deco-scm-agency-material',
          name: 'DecoScmAgencyMaterial',
          component: () =>
            import('@/views/deco/scm/agency/material/list/index.vue'),
          meta: {
            locale: '材料供应商',
            requiresAuth: true,
            roles: ['*'],
          },
        },
        {
          path: '/deco-scm-agency-labour',
          name: 'DecoScmAgencyLabour',
          component: () =>
            import('@/views/deco/scm/agency/labour/list/index.vue'),
          meta: {
            locale: '劳务供应商',
            requiresAuth: true,
            roles: ['*'],
          },
        },
        {
          path: '/deco-scm-agency-carriage',
          name: 'DecoScmAgencyCarriage',
          component: () =>
            import('@/views/deco/scm/agency/carriage/list/index.vue'),
          meta: {
            locale: '承运供应商',
            requiresAuth: true,
            roles: ['*'],
          },
        },
      ],
    },
  ],
};

export default DECO_SCM;
